package com.freeman.cement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.freeman.cement.entity.Camera;
import com.freeman.cement.entity.CameraSquare;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface CameraDao extends BaseMapper<Camera> {
    List<Camera> findCamera(@Param("regionIndexCode") String regionIndexCode, @Param("isEnabled") Integer isEnabled);
    List<Camera> selectNotConfiguredCamera();
    List<Camera> selectCameraByIndexCode(@Param("cameraIndexCode") String cameraIndexCode);
    Camera selectCameraByIdToMap(@Param("id") int id);
    Camera selectCameraByIdToSimpleMap(@Param("id") int id);
    //取出全部摄像头
    List<Camera> selectAllCameras();
    //查找摄像头
    List<Camera> selectCamera(Camera camera);
    void updateCamera(Camera camera);
    //void clearTable(@Param("tableName") String tableName);
    void clearTable();
    int insertCameras(List<Camera> list);
    int insertCamera(Camera camera);
    /**
     * 获取系统摄像头总数
     * @return
     */
    int getCameraCount();
    /**
     * 获取某个值班室所管辖的摄像头总数
     * @param deptDutyId
     * @return
     */
    int getCameraCountInDutyRoom(@Param("deptDutyId") int deptDutyId);
    List<Camera> selectCameraByKeyword(@Param("keyword") String keyword);
    List<Camera> selectCameras(@Param("deptId") Integer deptId, @Param("worksectionId") Integer worksectionId, @Param("deptDutyId") Integer deptDutyId, @Param("isEnabled") Integer isEnabled, @Param("isRecvEnabled") Integer isRecvEnabled, @Param("keyword") String keyword);
    /**
     * 根据值班室ID获取摄像头数量
     */
    int getCameraCountByDutyRoomId(Integer dutyRoomId);
}
